#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "InvocationAction.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class InputPin;
class Signal;

/// <summary>
/// SendSignalAction
/// A SendSignalAction is an InvocationAction that creates a Signal instance and
/// transmits it to the target object. Values from the argument InputPins are used
/// to provide values for the attributes of the Signal. The requestor continues
/// execution immediately after the Signal instance is sent out and cannot receive
/// reply values.
/// </summary>
class UMLMODEL_EXPORT SendSignalAction : public InvocationAction {

public: // Constructors and destructors
    explicit SendSignalAction(const QString& umlType="uml::SendSignalAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// signal getter
    /// The Signal whose instance is transmitted to the target.
    /// </summary>
    shared_ptr<Signal> signal() const;

    /// <summary>
    /// signal setter
    /// The Signal whose instance is transmitted to the target.
    /// </summary>
    void setSignal(shared_ptr<Signal> value);

    /// <summary>
    /// target getter
    /// The InputPin that provides the target object to which the Signal instance is
    /// sent.
    /// </summary>
    shared_ptr<InputPin> target() const;

    /// <summary>
    /// target setter
    /// The InputPin that provides the target object to which the Signal instance is
    /// sent.
    /// </summary>
    void setTarget(shared_ptr<InputPin> value);

private: // Fields
    /// <summary>
    /// signal
    /// The Signal whose instance is transmitted to the target.
    /// </summary>
    shared_ptr<Signal> signal_;

    /// <summary>
    /// target
    /// The InputPin that provides the target object to which the Signal instance is
    /// sent.
    /// </summary>
    shared_ptr<InputPin> target_;

};

} // namespace uml
